using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;

namespace HengTong.Model.Db.Hr.Attendance
{
    /// <summary>
    /// 打卡记录表，记录由考勤机推送来的原始打卡记录
    /// </summary>
    public class SysAttendanceRawRecord : TopBasePoco
    {
        /// <summary>
        /// 获取或设置人员ID
        /// </summary>
        /// <value>打卡的人员ID</value>
        [Display(Name = "人员", Description = "打卡的人员", GroupName = "基本信息")]
        public Guid? PersonId { get; set; }

        /// <summary>
        /// 获取或设置人员导航属性
        /// </summary>
        /// <value>打卡的人员实体</value>
        public SysPerson Person { get; set; }
        
        /// <summary>
        /// 工号
        /// </summary>
        [Display(Name = "工号", Description = "员工工号", GroupName = "基本信息")]
        [StringLength(128)]
        public string StaffNo { get; set; }

        /// <summary>
        /// 获取或设置打卡时间
        /// </summary>
        /// <value>实际的打卡时间</value>
        [Display(Name = "打卡时间", Description = "实际的打卡时间", GroupName = "时间信息")]
        [Required(ErrorMessage = "打卡时间不能为空")]
        public DateTime PunchTime { get; set; }

        /// <summary>
        /// 获取或设置考勤机设备号
        /// </summary>
        /// <value>考勤机的设备编号</value>
        [Display(Name = "设备号", Description = "考勤机的设备编号", GroupName = "设备信息")]
        [MaxLength(64)]
        public string DeviceId { get; set; }

        /// <summary>
        /// 获取或设置考勤机设备名称
        /// </summary>
        /// <value>考勤机的设备名称</value>
        [Display(Name = "设备名称", Description = "考勤机的设备名称", GroupName = "设备信息")]
        [MaxLength(128)]
        public string DeviceName { get; set; }

        /// <summary>
        /// 获取或设置打卡地点
        /// </summary>
        /// <value>打卡的地理位置或区域</value>
        [Display(Name = "打卡地点", Description = "打卡的地理位置或区域", GroupName = "位置信息")]
        [MaxLength(256)]
        public string Location { get; set; }

        /// <summary>
        /// 获取或设置经度
        /// </summary>
        /// <value>打卡位置的经度</value>
        [Display(Name = "经度", Description = "打卡位置的经度", GroupName = "位置信息")]
        public double? Longitude { get; set; }

        /// <summary>
        /// 获取或设置纬度
        /// </summary>
        /// <value>打卡位置的纬度</value>
        [Display(Name = "纬度", Description = "打卡位置的纬度", GroupName = "位置信息")]
        public double? Latitude { get; set; }

        /// <summary>
        /// 获取或设置打卡类型
        /// </summary>
        /// <value>打卡类型：上班打卡、下班打卡、中途外出等</value>
        [Display(Name = "打卡类型", Description = "打卡类型：上班打卡、下班打卡、中途外出等", GroupName = "基本信息")]
        [MaxLength(32)]
        public string PunchType { get; set; }

        /// <summary>
        /// 获取或设置识别方式
        /// </summary>
        /// <value>识别方式：指纹、人脸、刷卡等</value>
        [Display(Name = "识别方式", Description = "识别方式：指纹、人脸、刷卡等", GroupName = "基本信息")]
        [MaxLength(32)]
        public string RecognitionType { get; set; }

        /// <summary>
        /// 获取或设置原始数据
        /// </summary>
        /// <value>考勤机推送的原始JSON数据</value>
        [Display(Name = "原始数据", Description = "考勤机推送的原始JSON数据", GroupName = "技术信息")]
        public string RawData { get; set; }

        /// <summary>
        /// 获取或设置处理状态
        /// </summary>
        /// <value>记录处理状态：未处理、已处理、处理失败等</value>
        [Display(Name = "处理状态", Description = "记录处理状态：未处理、已处理、处理失败等", GroupName = "基本信息")]
        [MaxLength(16)]
        public string ProcessStatus { get; set; } = "未处理";

        /// <summary>
        /// 获取或设置处理时间
        /// </summary>
        /// <value>记录被处理的时间</value>
        [Display(Name = "处理时间", Description = "记录被处理的时间", GroupName = "时间信息")]
        public DateTime? ProcessTime { get; set; }

        /// <summary>
        /// 获取或设置备注
        /// </summary>
        /// <value>打卡记录的备注信息</value>
        [Display(Name = "备注", Description = "打卡记录的备注信息", GroupName = "基本信息")]
        [MaxLength(512)]
        public string Remark { get; set; }
    }
}


